package stack_queue.queue;


import java.util.Arrays;
import java.util.PriorityQueue;

public class QueueTest {
    public static void main(String[] args) {
        int[] arr = {3,5,2,1,7,6,9,8,4,10};
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        for (int i : arr) {
            queue.offer(i);
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i] = queue.poll();
        }
        System.out.println(Arrays.toString(arr));
    }
}
